package com.cj.td.screen.layer;

import java.util.HashMap;

import org.loon.framework.android.game.action.map.Field2D;
import org.loon.framework.android.game.core.graphics.LImage;
import org.loon.framework.android.game.core.graphics.component.LLayer;

import com.cj.td.screen.actor.Begin;
import com.cj.td.screen.actor.End;

public class MapLayer extends LLayer {
	
	
	
	public MapLayer() {
		super(576, 480,false);
		//不锁定MapLayer拖拽
		setLocked(false);
		//锁定MapLayer中的角色拖拽
		setActorDrag(true);
		//设置MapLayer背景颜色（键值需要和map.txt文件表示相对应）
		HashMap<Integer,Object> pathMap = new HashMap<Integer,Object>(10);
		pathMap.put(new Integer(0), new LImage("/assets/sand.png"));
		pathMap.put(new Integer(1), new LImage("/assets/sandTurn1.png"));
		pathMap.put(new Integer(2), new LImage("/assets/sandTurn2.png"));
		pathMap.put(new Integer(3), new LImage("/assets/sandTurn3.png"));
		pathMap.put(new Integer(4), new LImage("/assets/sandTurn4.png"));
		pathMap.put(new Integer(5), new Begin("/assets/base.png"));
		pathMap.put(new Integer(6), new End("/assets/castle.png"));
		/**为LLayer加入简单的2D地图背景，瓦片大小为32*32，以rock图片为铺垫*/
		setField2DBackground(new Field2D("assets/map.txt", 32, 32), pathMap, "assets/rock.png");
		
		
	}
	
	

}
